package com.bihu.bihudemo.service;

import com.bihu.bihudemo.entity.CommentLike;
import com.bihu.bihudemo.entity.Question;
import com.bihu.bihudemo.entity.dto.LikedCountDTO;
import com.bihu.bihudemo.entity.vo.QuestionVo;

import java.util.List;

public interface RedisService {

    //存点赞信息到redis
    public void saveLiked2Redis(String likedCommentId, String likedPostId);

    //取消点赞
    public void unlikeFromRedis(String likedCommentId, String likedPostId);

    public void deleteLikedFromRedis(String likedCommentId, String likedPostId);

    public void incrementLikedCount(String likedCommentId);

    public void decrementLikedCount(String likedCommentId);

    /**
     * 将点赞信息封装成实体列表，方便做持久化操作
     * @return
     */
    public List<CommentLike> getLikedDataFromRedis();

    /**
     *
     * @return 拿到被点赞文章的ID和对应的获赞数（列表操作）
     */
    List<LikedCountDTO> getLikedCountFromRedis();


    /**
     *
     * 文章浏览数+1
     * @param question 文章
     */
    public void addViewNum(QuestionVo question);


    public void SynViewNum();


}
